package cn.cvs.dao;

import cn.cvs.pojo.SpareParts;
import cn.cvs.pojo.SysRole;
import cn.cvs.pojo.SysUser;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface SysUserMapper {
    /**
     * 统计用户数量
     * @return
     */
    int count();

    List<SysUser> list();

    List<SpareParts> listAndTime();

    List<SysUser> getUserByRealName(String realName);


    List<SysUser> getUserListByPojo(SysUser sysUser);

    List<SysUser> getUseListByMap(Map<String,Object> hashMap);

    List<SysUser> getUserListByParams(@Param("realName") String realName,@Param("roleId") int roleId);

    List<SysUser> getUserListWithRoleName(SysUser sysUser);

    List<SysUser> getUserListByRoleId(@Param("roleId") Integer roleId);

    List<SysUser> getUserAndAddressesByUserId(@Param("userId") Integer userId);

    /**
     * 添加
     *
     * @param user 用户
     * @return int
     */
    int add(SysUser user);

    int modify(SysUser user);

    int updatePwd(@Param("id") Integer id,@Param("password") String pwd);

    int deleteUserById(@Param("id") Integer id);

    int RoleAdd(SysRole role);

    int RoleUpdate(SysRole sysRole);

    int RoleDelete(Integer id);

    List<SysRole> LikeName(String name);


    List<SysUser> selectList(@Param("realName") String realName,@Param("roleId")Integer roleId);

    List<SysUser> selectListByChoose(@Param("realName")String realName, @Param("roleId") Integer roleId, @Param("account") String account , @Param("createdTime")Date createdTime);

    List<SysUser> getUserByRoleIdArray(Integer[] roleIds);

    List<SysUser> getUserByRoleIdList(List<Integer> roleList);

    List<SysUser> getUserByRoleIdMap(Map<String,Object> roleMap);

    int SysUserUpdate(SysUser sysUser);
    List<SysUser> selectList2(@Param("realName")String realName,@Param("roleId")Integer roleId);

    List<SysUser> limit(@Param("start") Integer start, @Param("size") Integer size);








}
